package com.tron.utils.tron;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class TronJob {



    /**
     * 定时任务，定时检测地址
     */
    @Scheduled(cron = "*/6 * * * * ?")
    public void searchAllTransactions() {
//        StringBuilder trxstr = new StringBuilder();
//        trxstr.append(TRXURL).append(GameAccount);
//
//        try {
//            HttpClient client = HttpClients.createDefault();
//            HttpGet request = new HttpGet(trxstr.toString());
//            //
//            request.addHeader("TRON-PRO-API-KEY", "61c7495c-eb99-46df-a1c7-e3c25aae1ece");
//            //request.addHeader("TRON-PRO-API-KEY", "fac9fa5c-ec1e-4373-b524-fc4f2166bf32");
//            BufferedReader reader = new BufferedReader(new InputStreamReader(client.execute(request).getEntity().getContent()));
//            StringBuilder responseBody = new StringBuilder();
//            String line;
//
//            while ((line = reader.readLine()) != null)
//                responseBody.append(line);
//
//            reader.close();
//            dealtrx(responseBody.toString(), ToAccount);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }


}
